<?php
namespace app\common\repositories\info;
use app\common\repositories\BaseRepository;
use app\common\dao\info\MapTaskRecordDao as dao;
/**
 * @mixin dao
 */
class MapTaskRecordRepository extends BaseRepository
{
    public function __construct(dao $dao)
    {
        $this->dao = $dao;
    }


    public function getList($where,$page,$limit)
    {
        // 1-全部 2-未标记 3-未导出 4红色 5-橙色 6-绿色 7-蓝色 8-灰色 9-已导出 10-回收站
        if($where['type'] == 1){

        }

        if($where['type'] == 2){
            $where['colorEmpty'] = 1;
        }

        if($where['type'] == 3){
            $where['is_export'] = 0;
        }

        if($where['type'] == 4){
            $where['color'] = '红色';
        }

        if($where['type'] == 5){
            $where['color'] = '橙色';
        }

        if($where['type'] == 6){
            $where['color'] = '绿色';
        }

        if($where['type'] == 7){
            $where['color'] = '蓝色';
        }

        if($where['type'] == 8){
            $where['color'] = '灰色';
        }

        if($where['type'] == 9){
            $where['is_export'] = 1;
        }

        if($where['type'] == 10){
            $where['is_del'] = 1;
        }


        $count = $this->dao->search($where)->count();
        $list = $this->dao->search($where)->order('record_id desc')->page($page,$limit)->select();

        return compact('list','count');
    }
}